home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / collide.z / collide
Encoding:
Text File  |  2002-10-03  |  4.3 KB  |  101 lines

  1. COLLIDE(1)                                             Last changed: 1-4-99
  2.  
  3.  
  4. NNAAMMEE
  5.      ccoolllliiddee - Look for name collisions between libraries
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ccoolllliiddee [--ll] [--dd] [--ww] _f_i_l_e  ...
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      IRIX systems
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      When porting a large application, a critical question is ``How do I
  15.      know if names in this application conflict with names in libraries I
  16.      must use?''  ccoolllliiddee answers that question by finding name collisions
  17.      across archive libraries and object files.  It treats a Dynamic Shared
  18.      Object (dso) as if it were an archive library.
  19.  
  20.      Given a list of files, ccoolllliiddee finds all duplicate external names and
  21.      writes those names to standard output.  There is no output if there
  22.      are no conflicts.
  23.  
  24.      The --ll (longform) option adds the object file names to the output.
  25.      This must be the first option to ccoolllliiddee if it is specified at all.
  26.  
  27.      The --dd (show duplicates) option reports duplicate external names on
  28.      standard error.  This reports the same problems aarr would if run on the
  29.      same object files but in more detail.  --dd applies to object files, not
  30.      archive libraries.
  31.  
  32.      The --ww (weak symbol) option treats weak symbols the same as normal
  33.      external symbols.  By default, weak symbols are ignored in the search
  34.      for duplicates.
  35.  
  36.      The _f_i_l_es named may be either archive libraries or object files.  A
  37.      list of object files is gathered together (by //uussrr//lliibb//ccoolllliiddee11) just
  38.      as is done by aarr(1).  Gathering of a list of objects stops when an
  39.      archive name is seen.  Object gathering is important because a common
  40.      declaration may appear in multiple files yet it does not reflect a
  41.      name duplication.
  42.  
  43.      ccoolllliiddee is a shell script that uses //uussrr//lliibb//ccoolllliiddee11 to extract the
  44.      public symbols from each archive (or gathered collection of objects)
  45.      and notes the object file name and archive name along with the symbol.
  46.      You may find it useful to find which library or object contains a
  47.      name, (the name may be a weak symbol).  For example, the following do
  48.      roughly the same thing:
  49.  
  50.           /usr/lib/collide1 -w /usr/lib/libc.a | grep strcpy
  51.           nm -Bo /usr/lib/libc.a | grep strcpy
  52.  
  53.      If there are too many objects to list them all on the command line,
  54.      use the aarr(1) command to build an archive.
  55.  
  56.      Examples:
  57.  
  58.           cd /usr/lib
  59.           collide libgl_s.a libc.a libcps.a /tmp/mylib.a
  60.           cd /usr/tmp
  61.           # a.o b.o treated as if in archive "none".
  62.           # c.o d.o treated as if in a separate archive "none".
  63.           collide -d a.o b.o /usr/lib/libc.a c.o d.o
  64.  
  65.           ar cr mylib.a *.o
  66.           collide  mylib.a /usr/lib/libc.a
  67.  
  68.           # Not useful. All the externals are collisions.
  69.           collide libc_s.a libc.a
  70.  
  71. FFIILLEESS
  72.      //uussrr//ssbbiinn//ccoolllliiddee
  73.      //uussrr//lliibb//ccoolllliiddee11
  74.  
  75. NNOOTTEESS
  76.      The format of a line written by ccoolllliiddee11 is:
  77.  
  78.           variable-name objectfile-name archive-name
  79.  
  80.      Each name is separated by a tab; the line ends with a newline.  There
  81.      are no blanks or extraneous characters in the output.
  82.  
  83.      If you supply object names to ccoolllliiddee, specify the --dd option.
  84.  
  85.      While the C language does not have FORTRAN common declarations per se,
  86.      the declaration iinntt cc;; will, if it appears outside of any function
  87.      declaration be marked in the symbol table as ccoommmmoonn (with Traditional
  88.      C only - not with ANSI C).
  89.  
  90. NNOOTTEESS
  91.      ccoommmmoonn declarations that appear in different archives can cause false
  92.      reports of duplications.  This should not happen if you put all your
  93.      objects in a single archive or list all your objects together on the
  94.      command line.
  95.  
  96.      ccoolllliiddee recognizes an object as a dso by looking for names ending in
  97.      ..ssoo or ..ssoo..<<NN>> (where <<NN>> is a number, as in ..ssoo..11) so dso's not named
  98.      that way are treated as simple object files.
  99.  
  100. SSEEEE AALLSSOO
  101.